<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        /* .fade-enter-active,
        .fade-leave-active {
            transition: opacity .5s;
        }

        .fade-enter,
        .fade-leave-to
        .fade-leave-active below version 2.1.8 */
        /* 可以设置不同的进入和离开动画 */
        /* 设置持续时间和动画函数 */
        
        .slide-fade-enter-active {
            transition: all .3s ease;
        }
        
        .slide-fade-leave-active {
            transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
        }
        
        .slide-fade-enter,
        .slide-fade-leave-to
        /* .slide-fade-leave-active for below version 2.1.8 */
        
        {
            transform: translateX(10px);
            opacity: 0;
            opacity: 0;
        }
    </style>
</head>

<body>
    <div id="demo">
        <button v-on:click="show = !show">
    Toggle
  </button>
        <transition name="fade">
            <p v-if="show">hello</p>
        </transition>
    </div>

</body>
<script>
    new Vue({
        el: '#demo',
        data: {
            show: true
        }
    })
</script>

</html>